<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <style>
        box:nth-child(){
            background-image: url();
        }
    </style> -->
</head>
<body>
    <div class="the_div">
        <p>我是p标签</p>
        <h3>我是h3</h3>
        <h3>我是h3</h3>
        <h3>我是h3</h3>
        <a id="theA" href="#">我是一个a标签</a>
        <ul>
            <li>北京</li>
            <li class="background">天津</li>
            <li>南京</li>
        </ul>
        <ol class="my_li">
            <li>大张</li>
            <li>大王</li>
            <li>大狗</li>
        </ol>
        <ul class="my_li">
            <li>小明</li>
            <li>小红</li>
            <li>小蓝</li>
        </ul>
    </div>

    <script>
        // 获取a标签
        const a = document.querySelector('#theA')
        console.log(a);

        // 获取h3标签
        const label = document.querySelectorAll('h3')
        console.log(label);

        // 获取li标签
        const li = document.querySelectorAll('li')
        console.log(li);

        // 获取小子开头的标签
        const small = document.querySelectorAll('ul[class= my_li] li');
        console.log(small);

        // 小红
        const myli = document.querySelector('ul[class= my_li] li:nth-child(2)');
        myli.innerHTML = '小六'
        myli.style.color = 'red'
        console.log(myli);

        // 修改背景颜色
        const Tianjin = document.querySelector('.background');
        console.log(Tianjin);
        Tianjin.style.backgroundColor = '#087'



    </script>
    
</body>
</html>